#ifndef __m_popup2_h__
#define __m_popup2_h__

///////////////////////////////////////////////////////////////
// Few notes about new popup api
// ------------------------------
// When you call any ADD service, Popup Plus creates local
// copy of POPUPDATA2 to store the data. Each time you call
// CHANGE service this data is updated. You can use the
// MS_POPUP_GETDATA2 service to retrieve Popups's copy of
// this data, however you MUST NOT chahge that.

// New Popup 2.1.x API Interface ID
// {4A3EDEA4-A8A4-400d-8F64-8F6EF4666F83}
#define MIID_POPUP2 { 0x4a3edea4, 0xa8a4, 0x400d, { 0x8f, 0x64, 0x8f, 0x6e, 0xf4, 0x66, 0x6f, 0x83 } }

// unicode or ansi mode
#define PU2_ANSI    0x00
#define PU2_UNICODE 0x01
#if defined(UNICODE) || defined(_UNICODE)
	#define PU2_TCHAR PU2_UNICODE
#else
	#define PU2_TCHAR PU2_ANSI
#endif

#define PU2_CUSTOM_POPUP 0x02

typedef struct
{
	// general
	int cbSize;
	DWORD flags;

	// miranda bindings
	HANDLE lchContact;
	HANDLE lchEvent;

	// style
	COLORREF colorBack;
	COLORREF colorText;
	HICON lchIcon;
	HBITMAP hbmAvatar;
	union
	{
		char *lpzTitle;
		WCHAR *lpwzTitle;
		TCHAR *lptzTitle;
	};
	union
	{
		char *lpzText;
		WCHAR *lpwzText;
		TCHAR *lptzText;
	};
	char *lpzSkin;

	// time and timeout
	int iSeconds;
	DWORD dwTimestamp;

	// plugin bindings
	WNDPROC PluginWindowProc;
	void *PluginData;
} POPUPDATA2, *LPPOPUPDATA2;

// Creates new popup
//    wParam = (WPARAM)(LPPOPUPDATA2)&ppd2
//    lParam = (LPARAM)(combination of APF_* flags)
//    returns: window handle (if requested) of NULL on success, -1 on failure.
#define MS_POPUP_ADDPOPUP2 "Popup/AddPopup2"

// Update an popup
//    wParam = (WPARAM)(HWND)hwndPopup
//    lParam = (LPARAM)(LPPOPUPDATA2)&ppd2
//    returns: zero on success, -1 on failure.
#define MS_POPUP_CHANGEPOPUP2 "Popup/ChangePopup2"

#endif //  __m_popup2_h__
